﻿Class MainWindow

  Private m_Group1SelectedRadioButton As String
  Private m_Group2SelectedRadioButton As String

  Private Sub RadioButtonGroup1_CheckedChanged(
      ByVal sender As Object,
      ByVal e As EventArgs) _
      Handles _
        RadioButton1.Checked,
        RadioButton2.Checked,
        RadioButton3.Checked
    Dim rb As RadioButton =
      DirectCast(sender, RadioButton)
    m_Group1SelectedRadioButton =
      rb.Content.ToString
    Me.TextBox1.Text =
      m_Group1SelectedRadioButton
  End Sub

  Private Sub RadioButtonGroup2_CheckedChanged(
    ByVal sender As Object,
    ByVal e As EventArgs) _
    Handles _
      RadioButton4.Checked,
      RadioButton5.Checked,
      RadioButton6.Checked
    Dim rb As RadioButton =
      DirectCast(sender, RadioButton)
    m_Group2SelectedRadioButton =
      rb.Content.ToString
    Me.TextBox2.Text =
      m_Group2SelectedRadioButton
  End Sub
End Class
